<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>渐变图</title>
</head>
<body>
    <div class="demo01"></div>
    <div class="demo02"></div>
    <style>
        .demo01{
            width: 300px;
            height: 300px;
            border: 5px solid #ba1717;
            background-image: linear-gradient(180deg,rgb(142, 39, 137),rgb(237, 125, 34));
        }
        .demo02{
            width: 300px;
            height: 300px;
            border: 5px solid #26b092;
            background-image: linear-gradient(180deg,rgb(27, 165, 89),rgb(42, 69, 202));
        }
        div{
            margin-bottom: 20px;
        }
    </style>
</body>
</html>